﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

using HZ.Supervise.Model;
using HZ.Supervise.IBLL;
using HZ.Supervise.Model.Query;
using System.Text;
using System.Data;

namespace HZ.Supervise.Web.Common
{
    public partial class FindAllCompany : BasePage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                dataBind();
            }
           
        }


        void dataBind()
        {
            //先绑总地区
            int total = 0;

            HZ.Supervise.BLL.BLL_PreWarning bllPre = new HZ.Supervise.BLL.BLL_PreWarning();
            DataTable dtCompany = new DataTable();

            dtCompany = bllPre.GetCompany(this.txtCompanyName.Text, AspNetPager1.CurrentPageIndex, AspNetPager1.PageSize, out total);
            AspNetPager1.RecordCount = total;

            gvwCompany.DataSource = dtCompany;
            gvwCompany.DataBind();
        }

        protected void AspNetPager1_OnPageChanged(object sender, EventArgs e)
        {
            dataBind();
        }

        protected void btnQery_Click(object sender, EventArgs e)
        {
            AspNetPager1.CurrentPageIndex = 1;
            dataBind();
        }



    }
}
